//
//  SuXiHomeVC.swift
//  SuXianCalculator
//
//  Created by 李东 on 2024/3/28.
//

import UIKit

class SuXiHomeVC: SuXiBaseVC {
    
    
    @IBOutlet weak var setting_top: NSLayoutConstraint!
    
    @IBOutlet weak var webItemView: UIView!
    @IBOutlet weak var birItemView: UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        hideNavgaitionBar()
        showBgImgView = true
        setting_top.constant = CGFloat.topPadding
        
        webItemView.tag = 10
        birItemView.tag = 11
        webItemView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(itemAction(sender:))))
        birItemView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(itemAction(sender:))))

    }


    @IBAction func settingAction(_ sender: Any) {
        navigationController?.pushViewController(SuXiMineVC(), animated: true)
    }
    
    
    @objc func itemAction(sender: UIGestureRecognizer) {
        guard let tempView = sender.view else {
            return
        }
        if tempView.tag == 10 {
            navigationController?.pushViewController(SuXiWebVC(url: AppConfig.H5_URL), animated: true)
        }else {
            navigationController?.pushViewController(SuXiBirthdayVC(), animated: true)
        }
    }

    
    
}
